﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RockBus.ServiceBus;

namespace InternalConferenceManagementSystem
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Starting the InternalConferenceManagementService.");

            SubscriberClient sc = null;
            try
            {
                Console.WriteLine("Setting up subscriptions for the InternalConferenceManagementService.");
                sc = new SubscriberClient(
                    typeof(InternalConferenceManagementService),
                    "conferences.*",
                    "http://localhost:8870/InternalConferenceManagementSystem/BasicHttp/");
                sc.ScanAssemblies(typeof(ConferenceMessages.ConferenceInfo).Assembly);
                sc.Subscribe();

                Console.WriteLine("InternalConferenceManagementService is ready and listening.");
                Console.WriteLine("Press any key to unsubscribe and exit...");
                Console.ReadLine();
            }
            finally
            {
                sc.Dispose();
            }
        }
    }
}
